<html>
<head>
<title>Automatic Grading System - Project 1B</title>
</head>
<body style="font-family:'arial'">
<h1>Project 1B</h1>

<table width='600' border = '1'>
<tr >
<th align='left' width='200'><a href='../proj1a/main.html'>PROJECT 1A</a></th>
<th align='left' width='200'><a href='../index.html'>RETURN TO MAIN</a></th>
<th align='left' width='200'><a href='../proj2/main.html'>PROJECT 2</a></th>
</tr>
<table>

<hr>
Source Code is available at: <a href='https://bitbucket.org/chucheng/cs143_autograding'>https://bitbucket.org/chucheng/cs143_autograding</a>. Please consult ChuCheng Hsieh for access (chucheng@ucla.edu)   

<hr>

<b>OVERVIEW</b><br>
Project 1B asks students to create SQL queries for designing a movie database system. The grading process executes student's work in sequence to create the table, load the data, and querying the database to answer questions. It provides some arguments for grader to change according to the project specification or grading environment. The outputs of the system are process log and student's grade in the text delimited form. This page has the instructions for how to execute the grading script. 
<br>
<hr>
<div style="width:600px;height:140px;border:2px dotted black;">
<b><u>BEFORE GRADING:</u></b>
<ul>
<li>Please install the same environment prepared by John Cho. Instruction can be found at <a href='../index.html'>main page</a>.</li>
<li>Please set up internet connection for the virtual machine according to the instruction above.</li>
<li>Please make sure your submission folder follow the required <a href='#structure'>structure</a>.</li>
</ul>
</div>

<br>

<div style="width:725px;height:1920px;border:2px dotted black;">
<b><u>HOW TO RUN THE PROGRAM:</u></b>
<h5 id='structure'>STEP1:</h5>
<p>Check the submission directory format.
<ol>
<li>The submission directory will contain directories with student's submission (named with their own id)</li>
<li>The student's directory will contain their work.</li>
</ol>
</p>
<div style="width:720px;height:290px;border:2px solid black;"><img src='./p1b/step1.jpg' alt='This screenshot shows the submission directory structure'></div>
<br>
<h5>STEP2:</h5>
Run the python script with your arguments. Please find the available <a href='#cfg'>arguments</a> below.<br> <div style="font-size:10pt"><b><i>- Type "./main.py -s [directory to be graded]" to execute the program.</b></i></div>
<div style="width:720px;height:48px;border:2px solid black;"><img src='./p1b/step2.jpg' alt='This screenshot shows an example for how to run the script'></div>

<h5>STEP3: <font color='red'>GRADING COMPLETED!!</font></h5>
Please find the grading result in "<b>RESULT/gradebook.txt</b>". This directory is generated in the grading process, and the gradebook file is in the tab delimited form.
<div style="width:720px;height:291px;border:2px solid black;"><img src='./p1b/gradebook.jpg' alt='This screenshot shows the location of gradebook file'><br>
</div>
<br><br><br>
<b id='cfg'><u>CONFIGURATIONS:</u></b>
<br>

The configurations of program can be found and modified in <b>config.py</b>. Moreover, some grading parameters are configured upon execution.

Before running the program, grader can provide the following configs:
<ul>
<li> Student submission directory [-s].<br> <div style="font-size:10pt"><b><i>[Default: The module will use "submissions" in the current directory for grading]</i></b></div></li>
<li> Database name [-d].<br> <div style="font-size:10pt"><b><i>[Default: CS143]</i></b></div></li>
<li> Database username [-u].<br> <div style="font-size:10pt"><b><i>[Default: cs143]</i></b></div></li>
<li> Timeout value in second [-t].<br> <div style="font-size:10pt"><b><i>[Default: 15 second]</i></b></div></li>
<li> Query parameter for testing students' PHP page [-q]. <div style="font-size:10pt"><b><i>[If the value is not specified, the module will not grade the PHP file automatically.]</i></b></div></li>
<li> Grade specific student's project only [-n].</li>
</ul>

<u style="font-size:10pt"><b>The following screenshot is the usage information of the grading script:</b></u>
<div style="width:720px;height:330px;border:2px solid black;"><img src='./p1b/help.jpg' alt='This screenshot shows the grading configuration usage page'></div>
<br>

The following parameters are also configurable in this module; however, they require user to modify the config.py manually.
<ol>
<li>The name of the script to be tested.</li>
<li>Output gradebook default location and filename.</li>
<li>The file name of test cases and solutions.
<font color='red'>Note: the test case script and solution need to be provided in these file explicitly.</font>
</li>
<li>Points for each testing criteria.</li>
<li>Configurations for testing student's PHP page.</li>

</ol>
<br>
</div>


<br>
<u><b>IMPORTANT NOTES</b></u><br>
1. Test case can be found in "<b>TESTCASES</b>" in the src directory. The testing query need to be provided in the file. Please find below the sample testcase and solution.<br>
<font color='red' size='2'>Note: the first row of the solution file is column header. It will not be considered as part of answer set.</font>
<div style="width:720px;height:422px;border:2px solid black;"><img src='./p1b/testcase.jpg' alt='This screenshot shows the sample of testcase and solution'></div>



<br>
2. The process log has the information of submissions count, error if any, grading note, and total grading time of the grading script ...etc.
<div style="width:720px;height:341px;border:2px solid black;"><img src='./p1b/log.jpg' alt='This screenshot shows the sample of log file'></div>


</body>
</html>